package org.thanos.demo.api;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.thanos.demo.entity.Demo;

@FeignClient(name = "zookeeper-service", fallback = DemoServiceFallback.class)
public interface DemoService {

    @RequestMapping(value = "/zookeeper-service/get")
    String getDemo(@RequestParam("name") String name);

    @RequestMapping(value = "/zookeeper-service/get/{name}")
    String getDemoParam(@PathVariable("name") String name);

    @RequestMapping(value = "/zookeeper-service/serviceHead")
    String postDemo(@RequestParam("name") String name);

    @RequestMapping(value = "/zookeeper-service/servicePost")
    String requestDemo(@RequestBody Demo demo);
}
